import { createRouter, createWebHistory } from "vue-router";
const routes = [
    {
        path: '/',
        name: 'Login',
        // 异步加载，打包时代码分割，性能优化
        component: () => import('../components/Login.vue')
    },
    {
        path: '/',
        redirect: "Login"
    },
    {
        path: '/main',
        name: 'main',
        component: () => import('../components/Main.vue'),
        children: [
            {
                path: '/Main/Product',
                name: 'Product',
                component: () => import('../components/Product.vue')
            }
        ]
    }
]

const router = createRouter({
    history: createWebHistory(),
    routes: routes
})
export default router;